package mc

import (
	"gitee.com/dreamwood/ez-go/db/mgo"
)

const (
	UnitEventNew           = "wms.UnitNew"
	UnitEventBeforeCreate  = "wms.UnitBeforeCreate"
	UnitEventBeforeUpdate  = "wms.UnitBeforeUpdate"
	UnitEventBeforeSave    = "wms.UnitBeforeCreate wms.UnitBeforeUpdate"
	UnitEventAfterCreate   = "wms.UnitAfterCreate"
	UnitEventAfterUpdate   = "wms.UnitAfterUpdate"
	UnitEventAfterSave     = "wms.UnitAfterCreate wms.UnitAfterUpdate"
	UnitEventDelete        = "wms.UnitDelete"
	UnitAccessControlEvent = "wms.UnitAccessControl"
)

func GetUnitConfig() *mgo.DocConfig {
	return Unit_Config
}

var Unit_Config *mgo.DocConfig

func init() {
	Unit_Config = NewUnitConfig()
}
func NewUnitConfig() *mgo.DocConfig {
	return &mgo.DocConfig{
		ContainerKey: "wms.Unit",
		Fields: []string{
			"name", "code", "sort",
		},
		RelationFields:  []string{},
		RelationConfigs: map[string]*mgo.DocRelation{},
		FieldFilter: map[string]*mgo.DocFieldFilter{
			"default": {
				Select: []string{},
				Omit:   []string{},
			},
		},
	}
}
